<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>目标伪类选择器</title>
  <style>
    /* 
    伪类选择器
    目标伪类选择器
    E:target 目标元素选择器
    */
    * {
      margin: 0px;
      padding: 0px;
    }
    .accordionMenu {
      background-color: #ffffff;
      color: #424242;
      font: 12px Arial, Verdana, sans-serif;
      width: 500px;
      padding: 10px;
      margin: 0 auto;
    }

    .accordionMenu h2{
      margin:5px 0;
      padding:0;
      position:relative;
    }
    .accordionMenu h2::before {
      border: 5px solid #ffffff;
      border-color: #fff transparent transparent;
      content: "";
      height: 0;
      width: 0;
      position: absolute;
      top: 14px;
      right: 10px;
    }

     .accordionMenu:target h2::before {
      border-color: transparent transparent #fff;
      top: 9px;
    }

    .accordionMenu h2 a {
      display: block;
      background-color: #8f8f8f;
      text-decoration: none;
      text-shadow: 2px 2px 2px #aeaeae;
      background: linear-gradient(top, #cecece, #8f8f8f);
      border-radius: 5px;
      color: #424242;
      font-size: 13px;
      font-weight: normal;
      padding: 10px;
      margin: 0px;
    }
    .accordionMenu:target h2 a,
    .accordionMenu h2 a:active,
    .accordionMenu h2 a:hover {
        background-color: #2288dd;
        color:#fff
    }

    .accordionMenu p {
      overflow: hidden;
      margin: 0px;
      padding: 0 10px;
      height: 0px;
      transition: height 0.5s ease-in;
    }

    .accordionMenu:target p {
      height: 100px;
      overflow: auto;
    }

   

  </style>
</head>

<body>
  <div class="accordionMenu">
    <div class="menuSection" id="brand">
      <h2>
        <a href="#brand">Brand</a>
      </h2>
      <p>Lorem ipsum dolor...</p>
    </div>
    <div class="menuSection" id="promotion">
      <h2>
        <a href="#promotion">Promotion</a>
      </h2>
      <p>Lorem ipsum dolor sit amet...</p>
    </div>
    <div class="menuSection" id="event">
      <h2>
        <a href="#event">Event</a>
      </h2>
      <p>Lorem ipsum dolor sit amet...</p>
    </div>
  </div>
</body>

</html>